package com.ruoyi.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.KnowledgeMapper;
import com.ruoyi.system.domain.Knowledge;
import com.ruoyi.system.service.IKnowledgeService;

/**
 * 知识库Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-09-05
 */
@Service
public class KnowledgeServiceImpl implements IKnowledgeService 
{
    @Autowired
    private KnowledgeMapper knowledgeMapper;

    /**
     * 查询知识库
     * 
     * @param knowledgeId 知识库主键
     * @return 知识库
     */
    @Override
    public Knowledge selectKnowledgeByKnowledgeId(Long knowledgeId)
    {
        return knowledgeMapper.selectKnowledgeByKnowledgeId(knowledgeId);
    }

    /**
     * 查询知识库列表
     * 
     * @param knowledge 知识库
     * @return 知识库
     */
    @Override
    public List<Knowledge> selectKnowledgeList(Knowledge knowledge)
    {
        return knowledgeMapper.selectKnowledgeList(knowledge);
    }

    /**
     * 新增知识库
     * 
     * @param knowledge 知识库
     * @return 结果
     */
    @Override
    public int insertKnowledge(Knowledge knowledge)
    {
        return knowledgeMapper.insertKnowledge(knowledge);
    }

    /**
     * 修改知识库
     * 
     * @param knowledge 知识库
     * @return 结果
     */
    @Override
    public int updateKnowledge(Knowledge knowledge)
    {
        return knowledgeMapper.updateKnowledge(knowledge);
    }

    /**
     * 批量删除知识库
     * 
     * @param knowledgeIds 需要删除的知识库主键
     * @return 结果
     */
    @Override
    public int deleteKnowledgeByKnowledgeIds(Long[] knowledgeIds)
    {
        return knowledgeMapper.deleteKnowledgeByKnowledgeIds(knowledgeIds);
    }

    /**
     * 删除知识库信息
     * 
     * @param knowledgeId 知识库主键
     * @return 结果
     */
    @Override
    public int deleteKnowledgeByKnowledgeId(Long knowledgeId)
    {
        return knowledgeMapper.deleteKnowledgeByKnowledgeId(knowledgeId);
    }
}
